package com.carl.dataSources.config;

public class DataSourceSwitch {

    private static final ThreadLocal<String> dataSourceTypes = new ThreadLocal<String>(){
        @Override
        protected String initialValue(){
            return DataSourceNames.FIRST;
        }
    };

    public static String getDataSource(){
        return dataSourceTypes.get();
    }

    public static void setDataSource(String dataSourceType){
        dataSourceTypes.set(dataSourceType);
    }

    public static void resetDataSource(){
        dataSourceTypes.set(DataSourceNames.FIRST);
    }


}
